﻿<Controls:SinacorWindow 
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
          xmlns:Custom="http://schemas.xceed.com/wpf/xaml/datagrid"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
          mc:Ignorable="d"
          xmlns:Model="clr-namespace:Sinacor.UI.Bovespa.Corretagem.Model;assembly=Sinacor.UI.Bovespa.Corretagem.Model"
          xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
          WindowStartupLocation="CenterScreen" 
          AutoContentHeight="True" 
          AutoContentWidth="True"
          WindowState="Normal"
          Width="800"
          Height="750"
          Title="{DynamicResource Bovespa.Corretagem.Label.TipoDescontoDiferenciado}" 
          x:Class="Sinacor.UI.Bovespa.Corretagem.View.SmartClient.TipoDescontoDiferenciado" 
          ModulePlus="False"
          ModuleId="ORD">

    <Controls:SinacorExpanderContainer>
        <Controls:SinacorExpander Header="{DynamicResource Bovespa.Corretagem.Label.TiposDesconto}" IsExpanded="True" AllowExpand="False">
            <Grid>
                <Controls:SinacorDataGrid x:Name="dtgTipoDescontoDiferenciado"
                                          RowEditMode="AllCells"
                                          ItemsSource="{Binding ListaTiposDescontosDiferenciados}"
                                          AllowDelete="True">
                    <Controls:SinacorDataGrid.Columns>
                        <Controls:Column Name="IdTpDesconto"
                                         IsRequired="True"
                                         AllowInsert="False"
                                         AllowUpdate="False"
                                         DisplayMemberPath="Codigo"
                                         Integers="3"
    								     Title="Bovespa.Corretagem.Label.IdTpDesconto"
										 HorizontalCellAlignment="Right"/>
                        <Controls:Column Name="Descricao"
                                         IsRequired="True"
                                         AllowInsert="True"
                                         AllowUpdate="True"
                                         DisplayMemberPath="Descricao"
                                         MaxLength="20"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                         RequiredErrorMessage="Bovespa.Corretagem.Message.DescricaoTipoDescontoDiferenciadoObrigatorio"
    								     Title="Bovespa.Corretagem.Label.Descricao">
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorTextBox x:Name="txtDescricao" 
                                                             MaxLength="20" 
                                                             IsRequired="True" 
                                                             RequiredErrorMessage="Bovespa.Corretagem.Message.DescricaoTipoDescontoDiferenciadoObrigatorio"
                                                             Text="{Binding Descricao}">
                                    </Controls:SinacorTextBox>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                        </Controls:Column>
                        <Controls:Column Name="PercentualObrigatoria"
                                         IsRequired="True"
                                         AllowInsert="True"
                                         AllowUpdate="True"
                                         DisplayMemberPath="Obrigatorio"
    								     Title="Bovespa.Corretagem.Label.PercentualObrigatoria"
										 HorizontalCellAlignment="Center"/>
                    </Controls:SinacorDataGrid.Columns>
                </Controls:SinacorDataGrid>
            </Grid>
        </Controls:SinacorExpander>
    </Controls:SinacorExpanderContainer>


</Controls:SinacorWindow>
